<?php

/**
 * Base project form.
 * 
 * @package    reduceri-cadouri
 * @subpackage form
 * @author     Your name here 
 * @version    SVN: $Id: BaseForm.class.php 20147 2009-07-13 11:46:57Z FabianLange $
 */
class ContactForm extends BaseForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'name'    => new sfWidgetFormInput(),
      'email'   => new sfWidgetFormInput(),
      'message' => new sfWidgetFormTextarea(),
    ));
    $this->widgetSchema->setLabels(array(
      'name'  => 'Numele tau',
      'email'  => 'Adresa de email',
      'message'  => 'Mesaj',
    ));
    
    $this->setValidators(array(
      'name'    => new sfValidatorString(array('required' => false)),
      'email'   => new sfValidatorEmail(array('required' => false), array('invalid' => 'Adresa de email nu este corecta')),
      'message' => new sfValidatorString(array('required' => true), array('required' => 'Mesajul este obligatoriu')),
    ));
    
    $this->widgetSchema->setNameFormat('contact[%s]');
  }
}
